# Copyright 1999-2009 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
# $Header: /var/cvsroot/gentoo-x86/net-proxy/3proxy/3proxy-0.6-r1.ebuild,v 1.1 2009/03/24 19:30:59 mrness Exp $

EAPI="2"

inherit toolchain-funcs eutils

DESCRIPTION="really tiny cross-platform proxy servers set"
HOMEPAGE="http:///3proxy.ru/"
SRC_URI="http://www.3proxy.ru/current/3proxy-0.7-devel.tar.gz"

LICENSE="3proxy"
SLOT="0"
KEYWORDS="~amd64 ~ppc ~x86"
IUSE="odbc plugins"

RDEPEND="odbc? ( dev-db/unixODBC )"

DEPEND="$RDEPEND"

S="${WORKDIR}/3proxy-0.7-devel"

src_prepare() {
	epatch "${FILESDIR}"/3proxy-0.7-gentoo.patch
	use odbc && epatch "${FILESDIR}"/3proxy-0.7-odbc.patch
}

src_compile() {
 	cd ${S}
	emake -f Makefile.Linux \
		|| die "emake failed"
}

src_install() {
 	cd ${S}
 	emake -f Makefile.Linux DESTDIR="${D}" install || die "emake install failed"
	if use plugins ; then
	  exeinto /usr/lib
	  doexe src/*.ld.so
	fi
}
